<template>
	<div class="dashboard">
		<div class="card" v-for="(item, index) in stats" :key="index">
			<div class="icon">{{ item.icon }}</div>
			<div class="info">
				<div class="value">{{ item.value }}</div>
				<div class="title">{{ item.title }}</div>
			</div>
		</div>
	</div>
</template>

<script setup>
import { ref } from 'vue';

const stats = ref([
	{ title: '子站异常', value: 33, icon: '⚠️' },
	{ title: '电站统计', value: 1, icon: '📊' },
	{ title: '电站发电', value: 6, icon: '⚡' },
	{ title: '电站停机', value: 17, icon: '🛑' },
	{ title: '通讯异常', value: 2, icon: '📶' },
	{ title: '电站容量', value: 15, icon: '⚙️' },
]);
</script>

<style scoped>
.dashboard {
	display: flex;
	flex-wrap: nowrap;
	border-radius: 0.8rem;
	justify-content: space-around;
	background-color: #11214e;
}

.card {
	color: white;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 22%;
	margin: 0.8rem;
	border-radius: 0.8rem;
	border: 1px solid #1a2b4c;
	box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.5);
}

.icon {
	font-size: 3rem;
	margin-right: 0.8rem;
}

.info {
	display: flex;
	align-items: center;
	flex-direction: column;
	justify-content: center;
}

.title {
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
}

.value {
	font-size: 1.5rem;
	font-weight: bold;
	color: #48a0f8;
}
</style>
